package cn.fengzhilun.javase.day03;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;

import org.junit.Test;

public class atClass {
	@Test
	public void test() {
		//Demo01(3);
		//assertEquals(getMax(1,3.0), 3);
		//getMax(3.1,4.2,7.8,9.1);
//		double array[]= {3.1,4.2,7.8,9.1};
//		System.out.println(getMax1(array));
       int array1[]= {};
       
//		System.out.println(getMax1(array1));

		//assertEquals(getMax(3.1,4.2,7.8,9.1), 9.1);
//		int x=10;
//		
//		change(x);
//		System.out.println(x);
       
//System.out.println(array1==null);
//System.out.println(array1[0]+"kong");
       changeArray(array1);
       System.out.println(Arrays.toString(array1));
	}
	public static void Demo01(int n ) {
		if(n<=0) {
			System.out.println("输入错误");
			return ;
		}
		for(int i=-n;i<=n;i++) {
			for(int j=-n;j<=n;j++) {
				if(Math.abs(i)==Math.abs(j)) {
					System.out.print("*");
					
				}else {
					
					System.out.print(" ");
				}
				
			}
			
			
		}
		
		
	}
	public static int getMax(int num1,int num2) {
		
		return num1>num2? num1:num2;
		
		
	}
	public static double getMax(int  num1,double num2) {
        return num1>num2? num1:num2;
		
	}
	public static double getMax(double... args) {
		double max= args[0];
		for(int i=1;i<args.length;i++) {
			max=max>args[i]?max:args[i];
			
			
		}
		
		
		return max;
	}
	public static double getMax1(double array[]) {
		if(array==null&&array.length==0) {
			
			return Double.MIN_VALUE;
			
		}
		double max=array[0];
		for(int i=1;i<array.length;i++) {
			max=max>array[i]?max:array[i];
			
		}
		return max;
	}
	public static void change(int a ) {
		a=20;
		System.out.println(20);
		
	}
	public static void changeArray(int[] array1) {
		 array1=new int[1];
		array1[0]=1;
	       System.out.println(Arrays.toString(array1));

	}
}
